<template>
	<el-container>
		<el-main class="nopadding">
				<sc-Table
					:border="true"
					:stripe="true"
					:hidePagination="false"
					:hideDo="false"
					stripe remoteSort remoteFilter
					row-key="id"
					:data="tableData"
					@edit="handleEdit"
					@delete="handleDelete"
					@show="handleShow"
					:column="tableColumns">
				</sc-Table>
		</el-main>
	</el-container>
</template>

<script>
import column from './columns.js'
import data from './data.js'
export default {
	name: 'arthas_list',
	components: {
	},
	data() {
		return {
			tableData: data,
			tableColumns: column,
		}
	},
	watch: {},

	mounted() {},
	async created() {},
	methods: {
		handleEdit(row ){
			console.log(row)
		},
		handleDelete(row){
			console.log(row)
		},
		handleShow(row) {
			let agentId = encodeURIComponent(btoa(row.agenId));
			let clientConnectHost = encodeURIComponent(btoa(row.host));
			let clientConnectTunnelPort = encodeURIComponent(btoa(row.clientConnectTunnelPort));
			const params = new URLSearchParams({
				agentId,
				clientConnectHost,
				clientConnectTunnelPort,
			}).toString();
			window.open(`/#/test/arthas/console/?${params}`, '_blank');

		},
		issue() {},
		close() {
			this.$refs.table.clearSelection()
			this.$refs.table.getData()
		}
	}
}
</script>
<style></style>
